package com.xunwulian.base.constant;

import com.xunwulian.base.util.EnumType;;

/**
 * Created by liyankai on 2016/9/3.
 */
public enum RoleType implements EnumType<RoleType, String, String> {

    SYSTEM("0", "系统"),
    ADMIN("1", "管理员"),
    COOPER("2", "公司客户"),
    SUBCOOPER("3", "公司子账户"),
    USER("4", "用户");

    public String role;
    public String desc;

    RoleType(String role, String desc) {
        this.role = role;
        this.desc = desc;
    }

    @Override
    public String getType() {
        return this.role;
    }

    @Override
    public String getDesc() {
        return this.desc;
    }

    /**
     * 判断用户类型
     *
     * @param roleType
     * @return
     */
    public static boolean isAdmin(RoleType roleType) {

        if (RoleType.ADMIN.getType().equals(roleType.getType())) {
            return true;
        }

        return false;
    }

}
